CFLAGS=-g -W
LIBS=-lX11 -lglut -lGL -lGLU -lm

OBJS= defs.o drawing.o font.o game.o generator.o menu.o mirrors.o objects.o textures.o tgaload.o  main.o
TARGET=Tetris

.PHONY:all

all:$(TARGET) 

clean:
	@rm -f $(OBJS)

defs.o:defs.c defs.h
	gcc $< $(CFLAGS) $(LIBS) -c

drawing.o:drawing.c drawing.h
	gcc $< $(CFLAGS) $(LIBS) -c

font.o:font.c font.h
	gcc $< $(CFLAGS) $(LIBS) -c

game.o:game.c game.h
	gcc $< $(CFLAGS) $(LIBS) -c

generator.o:generator.c generator.h
	gcc $< $(CFLAGS) $(LIBS) -c

menu.o:menu.c menu.h
	gcc $< $(CFLAGS) $(LIBS) -c

mirrors.o:mirrors.c mirrors.h
	gcc $< $(CFLAGS) $(LIBS) -c

objects.o:objects.c objects.h
	gcc $< $(CFLAGS) $(LIBS) -c

textures.o:textures.c textures.h
	gcc $< $(CFLAGS) $(LIBS) -c

tgaload.o:tgaload.c tgaload.h
	gcc $< $(CFLAGS) $(LIBS) -c

main.o:main.c 
	gcc $< $(CFLAGS) $(LIBS) -c

$(TARGET):$(OBJS)
	gcc $(OBJS) -o $@ $(CFLAGS) $(LIBS)


